import { defHttp } from '/@/utils/http/axios';
import { classListParams, classDetailParams } from './model/teacherModel';
import { ErrorMessageMode } from '/#/axios';

enum Api {
  ClassList = '/class/',
  ClassDetail = '/class/student/',
}

export function classListApi(params: classListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post(
    {
      url: Api.ClassList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function classDetailApi(params: classDetailParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.get(
    {
      url: Api.ClassDetail,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
